package org.darkforest.common.services.impl;

import org.darkforest.common.services.MerchantProxyService;
import org.darkforest.dao.mapper.ProxyMapper;
import org.darkforest.model.Proxy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * Created by valentina on 15/6/22.
 */
@Service
public class MerchantProxyServiceImpl implements MerchantProxyService{

    @Autowired
    private ProxyMapper proxyMapper;

    /**
     * 测试结算使用，仅添加proxy表
     * @param memberId
     * @param memberName
     * @return
     */
    @Override
    public int addProxyForTest(Integer memberId, String memberName) {
        Proxy proxy = new Proxy();
        proxy.setMemberProxyRel(memberId);
        proxy.setApplyMemberName(memberName);
        proxy.setApplyDate(new Date());
        proxy.setContactName("test");
        proxy.setContactPhone("18801234567");
        proxy.setContactEmail("test@bmaxtech.com");
        return proxyMapper.insert(proxy);
    }
}
